% function modeFinderData 

%% Load data into Y 
if isempty(dataStru.fileName)==true 
    error('dataStru.fileName is empty! Not loading data') 
end 
cd(dataStru.loadPath);
[Y,Ynames,sample,trainvec]=...
    load_dset(dataStru.fileName,dataStru.loadPath,dataStru,...
    dataStru.demeanType,flags.onscreen);
cd(cucd);

%% Determine subsamples with sampStru 
%  Create addsol.tauVec 
sampleStru.vector=sample;
sampleStru.cell=sample2date(sampleStru.vector); 
sampleStru.sampleVec=sampleStru.vector; 

if isfield(dataStru,'subSamples')==true && isempty(dataStru.subSamples)==false;  
    if isfield(dataStru,'subSamples')
        disp('Printing Subsamples');
        printcell(dataStru.subSamples);
    end
    disp('Addings breaks to sampleStru from dataStru'); 
    dataStru.sampleVec=sampleStru.sampleVec; 
    sampleStru=sampleAssignments(dataStru); 
    addsol.tauVec=sampleStru.tauVec; 
    if flags.onscreen==1 
        quer('c'); 
    end         
else
    addsol.tauVec=ones(size(Y,1),1); 
end 
